package com.example.demo.Controller;

import com.example.demo.dao.TroopRepository;
import com.example.demo.domain.Troop;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TroopController {

    @Autowired
    TroopRepository troopRepository;


    @RequestMapping("/savetroop")
    public Troop save(String name){

        Troop u = troopRepository.save(new Troop(name));

        return u;

    }
}
